package com.chexiehui.jc.mvp.car;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.CarInfo;
import com.chexiehui.jc.entity.DictInfo;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * 分期购车
 **/
public interface StagesBuyCarListCovenant {

    interface View extends BaseView {
        void onGetListSuccess(BaseModel<BasePage<CarInfo>> successResult);
        void onGetListFailure(BaseModel<Object> failureResult);
        void onAddShopInquirySuccess(BaseModel<Object> successResult);
        void onAddShopInquiryFailure(BaseModel<Object> failureResult);
        void onGetCraGradeListSuccess(BaseModel<List<DictInfo>> successResult);
        void onGetCraGradeListFailure(BaseModel<Object> failureResult);
        void onGetCountryTypeListSuccess(BaseModel<List<DictInfo>> successResult);
        void onGetCountryTypeListFailure(BaseModel<Object> failureResult);

        String getCityName();
        String getDescStr();
        String getBrandId();
        String getSeriesId();
        String getDownPaymentsMin();
        String getDownPaymentsMax();
        String getMonthlyLawMin();
        String getMonthlyLawMax();
        String getMinPrice();
        String getMaxPrice();
        String getGradeType();
        String getCountryType();

    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_STAGES_BUY_CAR_LIST)
        Observable<BaseModel<BasePage<CarInfo>>> getList(
                @Field("city") String city,
                @Field("descStr") String descStr,
                @Field("brandid") String brandid,
//                @Field("seriesid") String seriesid,
                @Field("downPaymentsMin") String downPaymentsMin,
                @Field("downPaymentsMax") String downPaymentsMax,
                @Field("monthlyLawMin") String monthlyLawMin,
                @Field("monthlyLawMax") String monthlyLawMax,
                @Field("minPrice") String minPrice,
                @Field("maxPrice") String maxPrice,
                @Field("type") String type,
                @Field("country") String country,
                @Field("pageIndex") int pageIndex,
                @Field("pageSize") int pageSize);

        @FormUrlEncoded
        @POST(Constants.URL_CAR_ADD_SHOP_INQUIRY)
        Observable<BaseModel<Object>> addShopInquiry(
                @Field("type") String type,
                @Field("carid") String carid,
                @Field("shopids") String shopids,
                @Field("phone") String phone,
                @Field("name") String name,
                @Field("city") String city);
        @FormUrlEncoded
        @POST(Constants.URL_CAR_GRADE_LIST)
        Observable<BaseModel<List<DictInfo>>> getCraGradeList(@Field("timespan") String timespan);
        @FormUrlEncoded
        @POST(Constants.URL_COUNTRY_TYPE_LIST)
        Observable<BaseModel<List<DictInfo>>> getCountryTypeList(@Field("timespan") String timespan);
    }

    interface Presenter {
        void getList(int pageNum);
        void addShopInquiry(String carid, String shopids, String phone, String name, String city);
        void getCraGradeList();
        void getCountryTypeList();
    }

}